// /cloudfunctions/getUsers/main.js
'use strict';
const db = uniCloud.database();

exports.main = async (event, context) => {
    const res = await db.collection('users').field({
        username: true,
        email: true,
        role: true
    }).get();
    return {
        code: 200,
        data: res.data
    };
};